package com.douqu.game.core.entity.world.map;

import com.douqu.game.core.entity.EntityObject;
import com.douqu.game.core.factory.ConfigFactory;
import com.douqu.game.core.factory.DataFactory;

/**
 * @Author: Bean
 * @Description:
 * @Date: 2018-05-15 19:03
 */
public class OccupyCityParam extends EntityObject {

    /**
     * 占领时间
     */
    private long occupyTime;

    /**
     * 占领前的阵营
     */
    private int beforeCamp;

    /**
     * 占领城的玩家
     */
    private SpriteBean winner;

    private SpriteBean loser;

    public OccupyCityParam(long occupyTime, int beforeCamp, SpriteBean winner, SpriteBean loser)
    {
        this.occupyTime = occupyTime;
        this.beforeCamp = beforeCamp;
        this.winner = winner;
        this.loser = loser;
    }

    public boolean isOverdue()
    {
        return DataFactory.currentTime - occupyTime >= ConfigFactory.WORLD_MAP_STATUS_WAIT_TIME;
    }

    public long getOccupyTime() {
        return occupyTime;
    }

    public void setOccupyTime(long occupyTime) {
        this.occupyTime = occupyTime;
    }

    public int getBeforeCamp() {
        return beforeCamp;
    }

    public SpriteBean getLoser() {
        return loser;
    }

    public void setLoser(SpriteBean loser) {
        this.loser = loser;
    }

    public SpriteBean getWinner() {
        return winner;
    }

    public void setWinner(SpriteBean winner) {
        this.winner = winner;
    }

    @Override
    public String toString() {
        return "{" +
                "occupyTime=" + occupyTime +
                ", beforeCamp=" + beforeCamp +
                ", winner=" + winner +
                ", loser=" + loser +
                "} ";
    }
}
